﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Icst.Leaflike.Web;
using Icst.Leaflike.Data;


namespace Icst.Leaflike.Web.search
{
    public partial class flower : pagesearch
    {
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            AddSelection(flowersSelector, Tree.HUAXING);
            AddSelection(fruitsSelector, Tree.GUOSHI);
            AddListbox(fruitColors, Tree.GUOSHIYANSE);
        }
        protected override string OnSave(bool empty)
        {
            SearchQuery[SearchOption.Huaxing] = empty ? string.Empty : flowersSelector.Selected;
            SearchQuery[SearchOption.Guoshi] = empty ? string.Empty : fruitsSelector.Selected;
            SearchQuery[SearchOption.Guoshiyanse] = empty ? string.Empty : fruitColors.SelectedValue;
            return "search_skin.htm";
        }

        protected override void OnLoad()
        {
            flowersSelector[SearchQuery[SearchOption.Huaxing]] = true;
            fruitsSelector[SearchQuery[SearchOption.Guoshi]] = true;
            if (!string.IsNullOrEmpty(SearchQuery[SearchOption.Guoshiyanse]))
                fruitColors.SelectedValue = SearchQuery[SearchOption.Guoshiyanse];
        }
    }
}
